<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        .wrapper {
            width: 500px;
            height: 500px;
            border: 2px solid;
            position: relative;
        }
        
        .inner {
            width: 300px;
            height: 300px;
            background: red;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
    </style>
</head>

<body>
    <div class="wrapper">
        <div class="inner"></div>
    </div>


    <script>
        let data = {}

        function type(data) {
            if (typeof data === "object") {
                if (data === "null") {
                    return "null"
                }
                return Array.isArray(data) ? "array" : "object"
            } else {
                return typeof data
            }
        }
    </script>

</body>

</html>